<div class="dialog_content">
    <form id="info_form" action="<if condition="$action_name=='add'">{:U('MaterialType/add')}<else />{:U('MaterialType/edit')}</if>" method="post">
        <table width="100%" class="table_form">
            
            <tr>
                <th>{:L('type_name')} :</th>
                <td><input type="text" name="type_name" class="input-text" id="J_type_name" value="{$info.type_name}" ></td>
            </tr>
        </table>
        <input type="hidden" name="type_id" value="{$info.type_id}" />
    </form>
</div>

<script>
        <volist name=":L('js_type')" id="val">
        lang.{$key} = "{$val}";
        </volist>
        $(function(){
            $.formValidator.initConfig({formid:"info_form",autotip:true});
            $("#J_type_name").formValidator({ onshow:lang.type_name, onfocus:lang.type_name}).inputValidator({ min:2, max:10, onerror:lang.type_name});
            $('#info_form').ajaxForm({success:complate,dataType:'json'});
            function complate(result){
                if(result.status == 1){
                    $.dialog.get(result.dialog).close();
                    $.TP.tip({content:result.msg});
                    window.location.reload();
                } else {
                    $.TP.tip({content:result.msg, icon:'alert'});
                }
            }
        });
</script>